Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve food import from JSON #529

Merged
merged 8 commits into from
Mar 23, 2022
Merged

Conversation

EmilJunker
Copy link
Contributor

@EmilJunker EmilJunker commented Mar 23, 2022

This improves the food import feature added in #528.

Imported items are now hidden unless the user explicitly searches for them or uses the category filter. This makes it possible to integrate all kinds of external databases without polluting the food list with unused entries, so we can close #388 and also close #230.

@davidhealey
Copy link
Owner

Does this include searching using the text search, rather than barcode? Does the search work if the user is offline?

@EmilJunker
Copy link
Contributor Author

Does this include searching using the text search, rather than barcode?

It refers exclusively to the local text search. Scanning a barcode or doing an online search (by hitting Enter) won't find these imported items.

Does the search work if the user is offline?

Yes.

@davidhealey
Copy link
Owner

So if I type "a" all the hidden foods containing the letter "a" will appear in the list?

@EmilJunker
Copy link
Contributor Author

Yes. If this is a problem, I could change it so these items only appear if you also apply a category filter. But then we would need to ensure during the import that the user selected at least one category to be applied to the items (because otherwise they could never be found).

@davidhealey
Copy link
Owner

I'm thinking it might be a little confusing because, when you don't press enter, the search box acts as a filter for the list of items you can see and when you press enter it searches for items you can't see. So revealing hidden items when filtering might be unexpected. But I think we should try it for now and see how it works in the real world.

@EmilJunker
Copy link
Contributor Author

I'm thinking it might be a little confusing because, when you don't press enter, the search box acts as a filter

I agree. I have now changed it so the hidden items only show up when the category search filter is applied. This makes for a much better user experience.

@davidhealey davidhealey merged commit fe91927 into davidhealey:master Mar 23, 2022
@EmilJunker EmilJunker deleted the food-import branch March 26, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Food Standards NUTTAB database Feature reguest: Add Fineli open data as data source
2 participants